<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link type="text/css" rel="stylesheet" href="css/site.css">
	<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	<title>Easytv 更新通知服务</title>
</head>
<body>
<h1 align="center">Easytv 更新通知服务</h1>

<!-- ************************************************************************************************* -->
<a href="/" >Home</a>  <c:if test="${user!=null}">| <a href="${LogoutURL}" >Logout</a></c:if> 
<c:if test="${user==null}">| <a href="${LoginURL}" >Login</a></c:if>    
<!-- ************************************************************************************************* -->
<c:if test="${user!=null}">
<h2>Step1.用户设置</h2>
	<form action="/user" method="post">
		<div class="divForm">
			Welcome, <label>${user.user.nickname}</label> 
			<input type="hidden" name="email" value="${user.user.email}"><br/>
			<input type="checkbox" name="notifierType" checked="checked" value="email">邮件通知
			<input type="checkbox" name="notifierType" value="sms" disabled="disabled">短信通知(Coming soon...)
			
			- 手机号：<input type="text" name="cellphone" value="${user.cellphone}"> 
			<button type="submit" style="padding:0 0 0 0;"><img src="./image/check.png"  height="28" title="保存并继续" ></img></button>
			<br/>
		</div>
    </form>
</c:if>

<!-- ************************************************************************************************* -->
<c:if test="${user!=null}">
<h2>Step2.增加自己关注的Easytv检查更新任务</h2>

<form action="/easytv" method="post">
	<div class="divForm">
		<input type="hidden" name="method" value="add"/>
		Easytv URL：<input type="text" name="easytv_url" size="100" value="http://easytv.echinatv.com.cn/ItemDet.aspx?IID=11768"><br/>
		Easytv 剧集名称：<input type="text" name="easytv_title" value="lost season 6"> <button type="submit" style="padding:0 0 0 0;"><img src="./image/add.png"  height="28" title="关注" ></img></button> <br/>
	</div>
</form>
    
<!-- ************************************************************************************************* -->
<h2>Step3.你也可以移除已关注的任务</h2>
<table width="80%">
<thead>
	<tr>
		<th width="80%">Easytv 剧集名称</th>	<th>移除关注	</th>
	</tr>
</thead>
<tbody>
<c:forEach items="${easytvEntityList}" var="e">
	<tr>
		<td width="80%">
			 ${e.title} - <a href="${e.url}">${e.url}</a> - <img onclick="$('p',$(this).closest('td')).slideToggle('slow');" src="./image/refresh.png"  height="28" ></img>
			 <p class="details">
				 <c:forEach items="${e.items}" var="item">
				 	<img src="./image/video.png"  height="16"></img>
				 	${item.itemTitle} - <a href="${item.itemLink}">${item.itemLink}</a> - <fmt:formatDate value="${item.updatedTime}" pattern="yyyy-MM-dd HH:mm:ss"/> <br/>
				 </c:forEach>
			 </p>
		</td> 
		<td>
			<form action="/easytv" method="post">
				<input type="hidden" name="easytv_url" value="${e.url}"/>
				<input type="hidden" name="method" value="delete"/>
				<button type="submit" style="padding:0 0 0 0;"><img src="./image/remove.png"  height="28" title="移除关注" ></img></button>
			</form> 
		</td>
	</tr>
</c:forEach>
</tbody>
</table>
</c:if>
<!-- ************************************************************************************************* -->
<br/>
<div id="footer" align="center">
<img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif" alt="由 Google App Engine 提供支持" />
<a href="http://www.haojii.com"><img src="./image/haojii.png" alt="haojii一个专注于技术的IT男" /></a>
</div>

</body>
</html>